<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<script type="text/javascript" src="../js/angular.min.js"></script>
	</head>
	<body>
		<div ng-app="myapp" ng-controller="myctrl">
			<div>
			<input type="text" name="name" ng-model="name"/>
			<!--绑定事件-->
			<input type="button" value="清空" ng-click="clearV()" />
			</div>
			<div>
				hello,{{name}}
			</div>
		</div>
		<script type="text/javascript">
			//初始化模块
			var myapp = angular.module("myapp",[]);
			myapp.controller("myctrl",["$scope",function($scope){
				$scope.name="黑马程序员";
				//在作用域上绑定事件
				$scope.clearV = function(){
					$scope.name = "";
				}
			}]);
		</script>
	</body>
</html>
